package com.jiawa.wiki;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.ConfigurableEnvironment;

@SpringBootApplication
@ComponentScan(basePackages = {"com.jiawa"})
/**
 * 该注解用于扫描包路径，扫描指定包路径下的所有类，并将其作为组件进行管理。
 */
@MapperScan(basePackages = "com.jiawa.wiki.mapper")
public class WikiApplication {
    public static void main(String[] args) {
        //以日志的形式打印配置文件信息
        Logger logger=LoggerFactory.getLogger(WikiApplication.class);

        SpringApplication springApplication = new SpringApplication(WikiApplication.class);

        ConfigurableEnvironment environment = springApplication.run(args).getEnvironment();

        logger.info("启动成功");
        logger.info(environment.getProperty("server.port"));
    }
}
